#!/usr/bin/env python3
import sys
import os

# Add the ccwork directory to the path
sys.path.insert(0, '/home/linden/claude/packages/ccwork')

# Test the display_directory_list function directly
try:
    from ccwork.cli import display_directory_list
    from ccwork.core import WorkdirStats
    from datetime import datetime
    
    # Create mock directory data
    mock_stats = WorkdirStats(
        workdir="/test/directory1",
        active_sessions=[],
        total_tokens=1000,
        input_tokens=500,
        output_tokens=500,
        cache_creation_tokens=0,
        cache_read_tokens=0,
        total_cost=0.10,
        last_activity=datetime.now(),
        session_count=2,
        models_used=["claude-3"]
    )
    
    directory_list = [(1, mock_stats)]
    
    print("Testing display_directory_list with simple_mode=False (detailed):")
    print("=" * 60)
    display_directory_list(directory_list, simple_mode=False)
    
    print("\nTesting display_directory_list with simple_mode=True (simple):")
    print("=" * 60)
    display_directory_list(directory_list, simple_mode=True)
    
    print("\n✅ Test completed successfully!")
    
except Exception as e:
    print(f"❌ Error: {e}")
    import traceback
    traceback.print_exc()